Field of the Disclosure
The present disclosure relates generally to processing systems and, more particularly, to timer management in processing systems.
Description of the Related Art
Processing systems implementing parallel processing increasingly rely on numerous timers to track various tasks. Most timer management systems treat timers not as physical counters, but rather as data elements allocated and instantiated in linked lists tied to a timer ring. In conventional timer rings, a different set of entries, or “buckets,” is maintained for each time unit (e.g., hours, minutes, seconds, milliseconds, etc.). When a timer is instantiated, the timer initially is placed in an initial entry of the set associated with the largest time unit of its initial time span. For each tick in this largest time unit, the timer is moved to the next entry representing the remaining time for the timer, and when the remaining time for the timer changes to a smaller time unit, the timer is moved to the corresponding entry in the set of entries associated with this smaller time unit, and so forth.
To illustrate, assume a timer ring includes a set of entries for the hour time unit (“hour set”), a set of entries for the minute time unit (“minute set”), and a set of entries for the second time unit (“second set”). A timer having an initial time span of, for example, 2 hours, would be placed in an entry of the hour set that represents a two hour span from the current entry in the hour set. When the remaining time on the timer switches from 1 hour to 59 minutes, the timer is moved from its entry in the hour set to an entry in the minute set representing a 59 minute span from the current entry in the minute set. When the remaining time on the timer switches from 1 minute to 59 seconds, the timer is then moved again to an entry of the second set that represents a span of 59 seconds from the current entry in the second set, and so forth. Thus, depending on its initial time span, a timer is moved between numerous timer rings before the timer expires. Moreover, depending on the number of timers currently pending and their distribution throughout the timer ring, each tick of the clock associated with a time unit may result in the reassignment of numerous timers in the entry associated with that clock tick. This frequent mass movement of timers among the entries of the conventional timer ring consumes considerable resource bandwidth, and thus limits the number of timers that may be effectively maintained in a processing system.